const jwt=require('jsonwebtoken')

let screat='sffadfsdgsdfgsdbsbdd'
let params={
    us:123,
    ps:456
}
//产生一个token
let token=jwt.sign(params,screat)//默认hs265加密
//验证token的合法性
console.log(token)

jwt.verify(token,screat,(err,data)=>{
        if(err){
            console.log('token验证失败')
        }
        console.log('token验证成功')
        // let t=new Date()
    
        // console.log(t.toLocaleDateString())//2021/1/10
        })


